using System.Collections;
using System.Web;
using AP.Core.Common;

namespace DTN.Core
{
    public class EmailFunction
    {
        public static bool SendEmail(string fromEmail, string toEmail, string eSubject, string eMessage, string sLink, string msgSubject)
        {
            EmailPacket objEmail = new EmailPacket();

            objEmail.Subject = eSubject;
            objEmail.To = toEmail;
            objEmail.EmailTemplate = HttpContext.Current.Server.MapPath(Constants.EmailTemplates.SendEmail);

            string link = Utilities.GetConfigKey(Constants.ConfigKey.WebsiteLink) + sLink;
            //Build mail
            Hashtable hst = new Hashtable();
            hst.Add("FromEmail", fromEmail);
            hst.Add("Title", eSubject);
            //hst.Add("Message", eMessage);
            hst.Add("Link", link);
            hst.Add("Subject", msgSubject);

            return objEmail.SendEmail(hst);
        }
    }
}